﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class export_judgeExport : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string judge_question_title = "";

        System.Data.DataTable table1 = new System.Data.DataTable();
        int count = 0;//总记录的条数
        try
        {
            
            if (Request.QueryString["judge_question_title"] != null)
            {
                judge_question_title = Request.QueryString["judge_question_title"].ToString().Trim();
            }
            

            
            List<string> wheres = new List<string>();

            if (judge_question_title != "")
            {
                wheres.Add("judge_question_title like '%" + judge_question_title + "%'");
            }
            string wh = "";
            if (wheres.Count > 0)
            {
                wh = string.Join(" and ", wheres.ToArray());
                
            }
            

            string sql = "select  judge_question_id ,'判断题' as question_type, judge_question_title ,course_id ,correct_answer from tb_judge_questions";
            if (wheres.Count > 0)
            {
                sql = sql + " where " + wh;
            }
            
            table1 = SqlServer.GetDataTable(sql);
        }



        catch (Exception ex)
        {
            Response.Write("<script>alert('有错误')</script>");
            Response.End();
        }
        string a = Json.ToJson(table1, count);
        Response.Write(Json.ToJson(table1, count));
        Response.End();
    }
}